<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/fuman/css/style.default.css" type="text/css" />
<script language="javascript">
	function checkson(sonid){
		if(document.getElementById("son"+sonid) != null){
			//判断有无子菜单
			//如果有子菜单，则子菜单的所有check状态和父亲一样
			var inputs = document.getElementsByName("logisticsName");
			for(var i=0;i<inputs.length;i++){
				if(inputs[i].id == "son"+sonid){
					if(document.getElementById("pre"+sonid).checked == true){
						inputs[i].checked = true;
					}else{
						inputs[i].checked = false;;
					}
				}
			}
		}
	}
	function searchform(){
		var objs = document.getElementsByName("logisticsName");
		if(objs != null && objs.length > 0){
			var countrynameStr = "";
			for(var i=0;i<objs.length;i++){
				if(objs[i].checked == true){
					if(countrynameStr.length <=0){
						countrynameStr = objs[i].value;
					}else{
						countrynameStr = countrynameStr + ";" + objs[i].value;
					}
				}
			}
			if(window.opener.document.getElementById("logisticsName") != null){
				window.opener.document.getElementById("logisticsName").value = countrynameStr;
				window.close();
			}else{
				alert("页面出错，请联系技术员");
			}
		}
	}

</script>
<body class="withvernav">
<div class="bodywrapper">
	<!--pageheader-->
	<div id="contentwrapper" class="contentwrapper">
		<div id="basicform" class="subcontent">
			<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
				<colgroup>
					<col class="con1" />
					<col class="con0" />
				</colgroup>
				<thead>
				<tr>
					<td colspan="2"  class="head0">
						<button type="button" class="submit radius2" id="btn" onClick="searchform()" >确定</button>
					</td>
				</tr>
				<tr>
					<td  class="head0"> {{foreach from=$logisticsname item=li key=key}}
						<br>
						<h4>
							<input type="checkbox" name="logisticsID[]" id="pre{{$li.0.name}}" value="{{$li.0.name}}" onClick="checkson('{{$li.0.name}}');"  />
							{{$key}}
						</h4>
						<br>
						<hr>
						<br>
						{{foreach from=$li name=infolist item=res key=key}}

						<div style="width:600px; float:left;overflow:hidden; text-overflow:ellipsis; white-space:nowrap;">
							<input type="checkbox" name="logisticsName" id="son{{$res.name}}" value="{{$res.logisticsValue}}" data-text="{{$res.id}}"  />
							{{$res.logisticsName}} </div>
						{{if $smarty.foreach.infolist.iteration % 2==0}}
						<br>
						{{/if}}
						&nbsp;&nbsp;{{/foreach}} <br>

						<br>
						<div style="clear:both"></div>
						{{/foreach}} </td>
				</tr>
				<tr>
					<td colspan="2"  class="head0"><button type="button" class="submit radius2" id="btn" onClick="searchform()" >确定</button></td>
				</tr>
				</thead>
			</table>
			<br />
		</div>
		<!--subcontent-->

		<!--subcontent-->

	</div>
	<!--contentwrapper-->

</div>
<!-- centercontent -->

</div>
<script>
	function checkCountry(){
		if(window.opener.document.getElementById("shopnameid") != null){
			var checkcountryname = window.opener.document.getElementById("shopnameid").value;
			if(checkcountryname.length > 0){
				checkcountryname = ";"+checkcountryname+";";
				var objs = document.getElementsByName("shopname");

				if(objs != null && objs.length > 0){
					for(var i=0;i<objs.length;i++){
						if(checkcountryname.indexOf(";"+objs[i].value+";") >= 0){
							//alert("包含");
							objs[i].checked = true;
						}
					}
				}
			}
		}
	}
	checkCountry();
</script>

<!--bodywrapper-->
</body>
</html>